var fs = require("fs");
var Q = require("q");

var fileName = "test.txt";

//将异步方法封装成promise
var fsReadFile = Q.nfcall(fs.readFile, fileName, "utf-8");

fsReadFile.then(function(result){
	console.log("----flag1-----" + result);
});

fs.readFile("test.txt", "utf-8", function(err, data){
	console.log("----flag2-----" + data);
});




